<?php
class Install_Form_Step2 extends Arm_Form
{
    public function init()
    {
        $config = Arm_Core::getConfigApplication();
        
        $element = new Zend_Form_Element_Text('php');
        $element->setLabel(Arm_Translate::_('Путь к php'));
        $element->setValue($config->system->path->php);
        $element->setDescription(Arm_Translate::_('Данный путь нужен для запуска cron команд ситемы'));
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('mysqldump');
        $element->setLabel(Arm_Translate::_('Путь к mysqldump'));
        $element->setValue($config->db->dump);
        $element->setDescription(Arm_Translate::_('Данный путь нужен для создания дампов базы данных'));
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('mysql');
        $element->setLabel(Arm_Translate::_('Путь к mysql'));
        $element->setValue($config->db->import);
        $element->setDescription(Arm_Translate::_('Данный путь нужен для импорта дампов'));
        $this->addElement($element);
        
        $field = new Install_Form_Fields();
        $element = new Zend_Form_Element_Text('host');
        $element->setLabel(Arm_Translate::_('Cервер'));
        $element->setValue('localhost');
        $element->setRequired(true);
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('port');
        $element->setLabel(Arm_Translate::_('Порт'));
        $element->setValue('3306');
        $element->setRequired(true);
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('charset');
        $element->setLabel(Arm_Translate::_('Кодировка'));
        $element->setValue('utf8');
        $element->setRequired(true);
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('adapter');
        $element->setLabel(Arm_Translate::_('Адаптер'));
        $element->setValue('pdo_mysql');
        $element->setRequired(true);
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('username');
        $element->setLabel(Arm_Translate::_('Пользователь'));
        $element->setRequired(true);
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('password');
        $element->setLabel(Arm_Translate::_('Пароль'));
        $element->setRequired(true);
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('dbname');
        $element->setLabel(Arm_Translate::_('База данных'));
        $element->setValue('arm_system');
        $element->setRequired(true);
        $this->addElement($element);
        
        // дампы базы данных
        $this->addElement($field->damp());
        
        $element = new Zend_Form_Element_Text('rootuser');
        $element->setLabel(Arm_Translate::_('Root Пользователь'));
        $this->addElement($element);
        
        $element = new Zend_Form_Element_Text('rootpassword');
        $element->setLabel(Arm_Translate::_('Root Пароль'));
        $this->addElement($element);
        
        $this->addElement($field->submit()->setAttrib('class', 'button'));
    }
}